OCAMLC=ocamlc
OCAMLOPT=ocamlopt
OCAMLDEP=ocamldep
INCLUDES= -I Source/ 
OCAMLFLAGS=$(INCLUDES) -I +sdl -I +lablgtk2 -I +lablGL -ccopt -L
OCAMLOPTFLAGS=$(INCLUDES) 
OCAMLLD= bigarray.cmxa sdl.cmxa sdlloader.cmxa lablgtk.cmxa lablgtkspell.cmxa

# List of files
OCR_OBJS= preprocess.ml rotation.ml segmentation.ml neuronal.ml interface.ml

rocnroll: $(OCR_OBJS)
	$(OCAMLOPT) -o bin/rocnroll $(OCAMLFLAGS) $(OCAMLLD) $(OCR_OBJS)

# Common rules
.SUFFIXES: .ml .mli .cmo .cmi .cmx

.ml.cmo:
	$(OCAMLC) $(OCAMLFLAGS) -c $<

.mli.cmi:
	$(OCAMLC) $(OCAMLFLAGS) -c $<

.ml.cmx:
	$(OCAMLOPT) $(OCAMLOPTFLAGS) -c $<

# Clean up
clean:
	rm -f bin/rocnroll
	rm -f *.cm[iox]
	rm -f *.o

# Dependencies
depend:
	$(OCAMLDEP) $(INCLUDES) *.mli *.ml > .depend

include .depend
